import { createApp } from "vue";
import App from "@/App.vue";
import router from "./router";
import _ from "lodash";
import "virtual:svg-icons-register";
import "./assets/styles/base.css";

const app = createApp(App);

app.config.globalProperties.$apath = "";

const componentContext = import.meta.globEager("./components/base/*.vue");
for (let path in componentContext) {
  const componentName = _.upperFirst(
    _.camelCase(
      path
        .split("/")
        .pop()
        .replace(/\.\w+$/, "")
    )
  );
  app.component(componentName, componentContext[path]);
}

app.use(router);
app.mount("#app");
